//
// Created by 29019 on 2019/9/11.
//

#ifndef LIBRTSP_C_LIBRTSP_H
#define LIBRTSP_C_LIBRTSP_H

#include "sock.h"
#include "thirdparty/map/src/map.h"
#include "stdio.h"
#include "list.h"

typedef struct _T_Param{
    char key[50];
    char value[140];
    struct list_head  p;
}Params;

typedef struct  _T_RtspClientCtx{
    char hostIp[30];
    int port;
    char despcrtion[50];
    Sock  sock;
    int cesq;
    boolean conn;
}RtspClient;
// callback function that receive data.
typedef int (*CallBack)(RtspClient *client,const char * data,int len);
typedef enum  _E_Method{
    OPTIONS = 0,
    POST,
    ANNOUNCE,
    SETUP,
    RECORD
}Method;
RtspClient *ConectRtsp(char *ip,int port,char *desc);
int GenPayload(Method method,char  *data);
int SendOption(RtspClient*p,CallBack *c);
int SendSetup(RtspClient *p,CallBack *c);
int SendRecord(RtspClient *p,CallBack *c);
int SendAnnounce(RtspClient *p,CallBack);

#endif //LIBRTSP_C_LIBRTSP_H
